/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2019年2月12日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package strategy.test2;

/**
 * @Type HomeContext
 * @Desc 负责和具体策略类交互 算法和客户端分离，可以通过spring等方式动态注入不同算法
 * @author 52489
 * @date 2019年2月12日
 * @Version V1.0
 */
public class Context {
    private Strategy strategy;

    /**
     * @param strategy
     */
    public Context(Strategy strategy) {
        super();
        this.strategy = strategy;
    }

    public void setStrategy(Strategy strategy) {
        this.strategy = strategy;
    }

    public void printPrice(double price) {
        System.out.println("您的报价是：" + strategy.getPrice(price));
    }

}
